import React from 'react';
import { View, Text, TouchableOpacity, Touchable,Image} from 'react-native';
import moment from 'moment'
import navigationhelper from 'src/components/navigationhelper'
import {CalendarList, LocaleConfig} from 'react-native-calendars';
import NavBar from 'src/components/navBar'
import Layer from 'src/components/Layer'
import {isIPhoneX,deviceWidth} from 'src/util'
import ScrollableTabView from 'react-native-scrollable-tab-view'



export default class myTeamUserCell extends React.Component {

    constructor(props) {
      super(props);
    }

    render(){
        const {itemData,typeCard} = this.props
          if(itemData.level == 1){
           stringLevel = '普通用户'
          }
          else if(itemData.level == 2){
           stringLevel = 'VIP会员'
          }
          else if(itemData.level == 3){
           stringLevel = '白金会员'
          }
          else{
           stringLevel = '未认证'
          }
        return(
        <View style={{backgroundColor:'#fff',paddingVertical:10,paddingHorizontal:20,flexDirection:'row',justifyContent:'space-between',alignItems: 'center',}}>
        
        <View>
        <View style={{alignItems: 'center',justifyContent:'flex-start',flexDirection:'row'}}>
        <Text style={{color:'#2E2E2E',fontSize:16,fontWeight:'bold'}}>{itemData.real_name_status === 1?itemData.real_name:itemData.nick_name}</Text>
        <View style={{marginLeft:10,borderWidth:1,borderRadius:6,borderColor:'#378EFB',paddingHorizontal:2.5,paddingVertical:2.5,justifyContent:'center',alignItems:'center'}}>
        <Text style={{color:'#378EFB',fontSize:12}}>{stringLevel}</Text>
        </View>
        </View>
        <Text style={{color:'#8E8E93',fontSize:12,marginTop:10}}>{itemData.create_time}</Text>
        </View>

        <TouchableOpacity
        activeOpacity ={0.8} onPress={()=>{
        this.props.lookUserDetail()
        // {typeCard == 1?navigationhelper.navigate('ChangeCreditCard'):navigationhelper.navigate('ChangeSaveCard')}
      }}>
        <View style={{justifyContent:'flex-end',alignItems:'flex-end'}}>
        <Text style={{fontSize:14,color:'#2E2E2E'}}>{itemData.mobile}</Text>
        <Text style={{fontSize:12,color:'#8E8E93',marginTop:5}}>{itemData.real_name_status == 1?<Text style={{color:'#76D358'}}>已认证</Text>:<Text style={{color:'#f00'}}>未认证</Text>}</Text>
        <Text style={{fontSize:12,color:'#378EFB',marginTop:5}}>查看详情</Text>
        </View>
      </TouchableOpacity>

        </View>
        ) 
    }
 }